home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pxsrc_21.zip / PAKMDEFN.H < prev    next >
Text File  |  1990-03-29  |  1KB  |  51 lines

  1. /*
  2.     PAKDEFN.H    Definitions for .PAK file handling utils.
  3. */
  4.  
  5. /*
  6. From APPNOTE.TXT in PKxPAK distribution file:
  7.  
  8. The general format for an archive file is:
  9.  
  10. [[archive-mark + header_version + file header + file data]...] + 
  11. archive-mark + end-of-arc-mark
  12.  
  13. The archive-mark is 1 byte and is the value 1A hex.  The file header
  14. can be defined by the following 'C' structure, and is 27 bytes in size.
  15. Note that this is a "packed" structure with fields aligned on odd-address
  16. boundries.
  17. */
  18.  
  19. #define uchar    unsigned char
  20. #define uint    unsigned int
  21. #define ushort    unsigned short
  22.  
  23. typedef struct        /* format of a .PAK file header: */
  24. {
  25.     char    type;        /* file type, or 0 for end of archive */
  26.     char    fname[13];    /* file name */
  27.     long    slen;        /* stored length of file in bytes */
  28.     ushort    ddate;        /* DOS file date */
  29.     ushort    dtime;        /* DOS file time */
  30.     ushort    crc;        /* CRC-16 of original data */
  31.     long    olen;        /* original length of file in bytes */
  32. } pak_hdr;
  33.  
  34. #define PAK_HDRLEN    (1+13+4+2+2+2+4)
  35.                 /* size of packed header */
  36.  
  37. #define PAK_MARK    '\x1A'    /* character marking start of ARC file */
  38.  
  39. int pak_dosort(char *fpath, char *fn, int sort);
  40.  
  41. #ifdef AMIGA
  42. #    define SEEK_SET 0
  43. #    define SEEK_CUR 1
  44. #    define SEEK_END 2
  45. extern    int        _NEAR_    errno;
  46. extern    int        _NEAR_    _OSERR;
  47. #endif
  48. /*
  49.     End of PAKDEFN.H header file.
  50. */
  51.